home *** CD-ROM | disk | FTP | other *** search
- /*
- Miranda Installer - Installs nightlies and Miranda addons.
- Copyright (C) 2002-2003 Goblineye Entertainment
-
- Authors: Saar (Tornado) and Kai (kai_b)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
- #pragma once
-
- #define WIN32_LEAN_AND_MEAN
- #define SIDEBYSIDE_COMMONCONTROLS 1
-
- #define _WIN32_WINNT 0x0400 // needed for WM_MOUSEWHEEL
-
- #include <windows.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <shellapi.h>
- #include <commctrl.h>
- #include <commdlg.h>
- #include <objbase.h>
- #include <shellapi.h>
- #include <shlobj.h>
- #include <ddeml.h>
-
- #include "Install.h"
- #include "PackageSelector.h"
- #include "Worker.h"
- #include "XMLParse.h"
- #include "zlib/unzip.h"
- //#include "langpack/langpack.h"
- #include "AggressiveOptimize.h"
- #include "Resource.h"
- /*
- #ifndef NDEBUG
- #include <crtdbg.h>
- #define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
- #endif*/
- #pragma hdrstop
-
- typedef unsigned char byte;
-
- #pragma comment(lib,"comctl32.lib")
- #pragma comment(lib,"comdlg32.lib")
-
- // GetModuleFileNameEx()
- typedef DWORD WINAPI GMFileNameEx(HANDLE,HMODULE,LPTSTR,DWORD);
- typedef GMFileNameEx *pGMFileNameEx;
-
-
- typedef struct MAIN_OPTIONS_TYPE
- {
- char szMirandaDirectory[MAX_PATH]; // Miranda's directory
-
- // more settings will follow here
- DWORD dwFlags; // LSB means if to ask if to autorun every type of file
- // next 2 bits: 0 - always ask what packages to install
- // 1 - always install all
- // 2 - always install main
- // 8 - 1 - if the user doesn't want to get warnings about miranda is running and such
- // profile
- char szDefaultProfile[MAX_PATH];
- // installation directories:
- char szIconDirectory[MAX_PATH];
- char szSoundDirectory[MAX_PATH];
- char szLangDirectory[MAX_PATH];
- char szToolDirectory[MAX_PATH];
- char szSrcDirectory[MAX_PATH];
- char szDocDirectory[MAX_PATH];
- char szSkinDirectory[MAX_PATH];
- } MAIN_OPTIONS;
-
-
- extern MAIN_OPTIONS g_WorkOptions;
- extern HINSTANCE g_hInstance;
- extern bool g_fStopThread;
-
- // DDE #define's
- #define DDE_SERVICE "MirInst_MirandaInstallerDat"
- #define DDE_TOPIC "PassCmdLineArgs3"
- #define DDE_ITEM "CmdLine"
-
- #define MI_CONTENT_TYPE "application/x-zip-mirandainstaller" // content type
- const WORD IndexToDirID[8] = { IDC_OPTSDLG_MIRANDADIR, IDC_OPTSDLG_ICONDIR, IDC_OPTSDLG_SOUNDDIR, IDC_OPTSDLG_LANGDIR, IDC_OPTSDLG_TOOLDIR, IDC_OPTSDLG_SRCDIR, IDC_OPTSDLG_DOCSDIR, IDC_OPTSDLG_SKINDIR };
-
- // Misc.cpp
- HWND Is_App_Running(void);
- void Format_DisplaySize(char *lpoutText,DWORD dwSize);
- void Cleanup_FileList(GENERAL_FILELIST **ppFileList);
- void Switch_Slashes(char *lpText,bool fReverse);
- void Restart_Miranda(void);
- // type registration
- bool RegisterApplication(const char *szTypeName, const char *szDescription);
- bool RegisterExtension(const char *szExtension, const char *szTypeName);
-
- // Procs.cpp
- INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
- INT_PTR CALLBACK LangPackDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
- INT_PTR CALLBACK AboutDlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam);
-
-
- // Language support
- // The translation file is always langpack.txt and
- // resides in the same directory as MirInst.exe
- void LP_Init(void); // initialize
- void LP_UnInit(void); // die
-
- // service types
- char *Translate(const char *lpString);
- void LP_TranslateDialog(HWND hwndDlg); // p.s. Also translates its menu